﻿using System;
using System.Windows.Data;
using CPETwit.WPFClient.Business.TwitterServiceReference;
using CPETwit.WPFClient.Common;

namespace CPETwit.WPFClient.Converter
{
    public class TweetContentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is Tweet)
            {
                Tweet tweet = value as Tweet;
                return CommonData.HasReTweeted(CommonData.LOGGED_USER, tweet) ?
                    "Annuler le retweet" : "Retweet";
            }
            return "Retweet";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
